{{extend './common/layout.html'}}
{{block 'link'}}
	<link rel="stylesheet" href="/home/css/article.css">
{{/block}}
{{block 'main'}}
	<!-- 头部框架开始 -->
	{{include './common/header.html'}}
	<!-- 头部框架结束 -->
	<!-- 文章框架开始 -->
	<div class="article">
		<div class="w1100">
			<div class="container">
				<div class="article-header">
					<h3 class="article-title">{{articleData.title}}</h3>
					<div class="article-info">
						<span class="author">{{articleData.author.username}}</span>
						<span>{{dataformat(articleData.publishDate)}}</span>
					</div>
				</div>
				<div class="article-content">
					{{@articleData.content}}
					
				</div>
				<div class="article-comment">
					{{if userInfo}}
					<h4>评论</h4>
					
					<form class="comment-form" action="/home/comment" method="post">
						<textarea class="comment" name="content"></textarea>
						<input type="hidden" name="uid" value="{{@userInfo._id}}">
						<input type="hidden" name="aid" value="{{@articleData._id}}">
						<div class="items">
							<input type="submit" value="提交">
						</div>
					</form>
					{{else}}
					<div><h2>先进行登录，再对文章进行评论</h2></div>
					{{/if}}
					<div class="comment-list">
						{{each commentData}}
						<div class="mb10">
							<div class="article-info">
								<span class="author">{{$value.uid.username}}</span>
								<span>{{dataformat($value.time,'yyyy-mm-dd')}}</span>
								<span>{{$value.uid.email}}</span>
								<span></span>
							</div>
							<div class="comment-content">
								{{$value.content}}
							</div>
						</div>
						{{/each}}
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 文章框架结束 -->
{{/block}}

